@import '@/styles/mixins/util';
@import "@/styles/mixins/function.scss";

.ellipsis {
  @include utils-ellipsis;

  display: block;
}

.project-template {
  height: 180px;
  background: #181d21;
  border: 1px solid #313539;
  border-radius: 12px;
  color: #ffffffe6;
  padding: 16px;
  overflow: hidden;

  .title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0;
  }

  .template-list {
    display: grid;
    // flex-wrap: wrap;
    justify-content: flex-start;
    color: #fff;
    font-size: 12px;
    // margin: 0 -16px;
    grid-template-columns: repeat(auto-fill, 160px);
    grid-gap: 14px;
   
    .template-item {
      width: 160px;
      height: 114px;
      box-shadow: var(--datav-shadow);
      margin: 14px 0px;
      transition: 0.2s;
      outline: 1px solid transparent;
      cursor: default;
      position: relative;
      overflow: hidden;

      .temp-snap {
        position: absolute;
        right: 1px;
        top: 0;
        z-index: 1;
        border-radius: 0 6px 0 8px;
      }

      .template-name {
        opacity: 0.7;
        font-weight: 500;
        font-size: 12px;
        color: #f2f8ff;
        word-break: break-word;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
      }

      .template-image {
        width: 100%;
        height: 163px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: 0.2s;
        position: relative;
      }

      .template-info {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px;
        height: 36px;
        background: var(--datav-bgcolor-2);
        transition: 0.2s;
      }

      &.--blank {
        position: relative;
        outline: var(--datav-border-primary);

        .template-image {
          box-shadow: inset 0 0 46px 0 rgb(136 215 255 / 29%);
        }

        .template-info {
          border-top: var(--datav-border-primary);
          justify-content: center;
          font-size: 14px;
        }
      }
    }
    .more-item {
      display: none;
      /* 这里添加你所需要的更多页面链接样式 */
    }

    .preview-image {
      width: 100%;
      height: 90px;
      object-fit: cover;
      position: relative;
      border: var(--datav-border);
      border-radius: 6px;

      &::after {
        @include cover-img;
      }
    }
    .more-text{
      text-align: center;
      font-size: 18px;
      line-height: 90px;
      a{
        color: var(--datav-main-color) !important; 
      }
    }

    .template-mask {
      position: absolute;
      left: 0;
      top: 0;
      right: 0;
      bottom: 0;
      background: rgb(0 0 0 / 50%);
      transition: 0.2s;
      pointer-events: none;
      display: flex;
      justify-content: center;
      align-items: center;
      flex-direction: column;
      opacity: 0;
      font-weight: 400;
      height: 90px;

      .create-btn {
        color: var(--datav-gui-font-color-1);
      }

      .preview-btn {
        margin-top: 10px;
        width: 112px;
        padding: 0 5px;
        margin-left: 0;
      }
    }

    .template-item:hover {
      .template-mask {
        pointer-events: all;
        opacity: 1;
      }
    }

    .template-name {
      font-size: 12px;
    }

    .template-size {
      color: #999;
      text-align: right;
      font-family: Orbitron-Bold, PingFangSC-Medium, "PingFang SC", "Microsoft YaHei", Arial, Helvetica, sans-serif;
    }

    .template-item-placehoder {
      width: 258px;
      margin: 16px;
    }
  }
}

.new-projects {
  display: flex;

  .title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0;
  }

  .create-new-project {
    width: 280px;
    height: 200px;
    margin: 16px 32px 16px 0;
    vertical-align: middle;
    background-color: #22272e;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    transition: all 0.25s ease-in-out;

    img {
      height: 93px;
      margin-top: calc(50% - 93px);
    }

    &:hover {
      background-color: #00000085;
      opacity: 0.7;
    }
  }

  .project-type {
    padding-left: 8px;
    flex: 1;
    font-size: 14px;
    color: var(--datav-main-color);
    margin-top: 4px;
  }
}

.project-header {
  // position: sticky;
  // top: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  z-index: 1;
  min-width: 1024px;

  .project-title {
    display: flex;
    align-items: center;
    padding: 5px 0;

    h2 {
      @include utils-ellipsis;

      max-width: 200px;
      font-size: 16px;
      color: var(--datav-gui-font-color-1);
      padding: 0 10px;

      .datav-tip-font {
        font-size: 14px;
      }
    }
  }

  .header-manager {
    display: flex;
    align-items: center;
    font-size: 14px;

    .n-button:not(:last-child) {
      margin-right: 16px;
    }

    .search-wrapper {
      display: flex;
      align-items: center;
      justify-content: space-between;

      .n-pagination{

      }

      .search {
        transform: translateX(30px);

        .search-input {
          @include utils-ellipsis;

          background: var(--datav-bgcolor-2);
          color: #fff;
          padding: 0 10px;
          line-height: 30px;
          height: 30px;
          padding-right: 30px;
          border: 1px solid transparent;
          transition: 0.2s;

          &:hover,
          &:focus {
            border: var(--datav-border-primary);
            box-shadow: var(--datav-shadow);
          }
        }
      }

      .icon-search {
        padding: 0 40px 0 4px;
        color: var(--datav-font-color);
        cursor: pointer;
        z-index: 1;
      }

      .sort-type {
        @include utils-ellipsis;

        display: inline-block;
        color: var(--datav-font-color);
        line-height: 30px;
        cursor: pointer;
        font-size: 14px;
        min-width: 100px;

        .icon-arrow {
          font-size: 14px;
          margin-left: 4px;
        }

        &:hover {
          color: var(--datav-main-color);
        }
      }
    }
  }
}

.main-screen {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  user-select: none;
  padding-bottom: 50px;
  height: calc(100vh - 306px);
  overflow-y: auto;

  .screen-item {
    position: relative;

    &.checked {
      :deep(.screen) {
        border: 1px solid var(--datav-main-color);
      }
    }
  }

  :deep(.n-checkbox-group) {
    display: contents;

    .n-checkbox {
      position: absolute;
      bottom: 27px;
      right: 100px;
    }
  }
}
